package com.zhentao.controller;

import com.zhentao.model.common.app.pojo.ApUserInfo;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.ApUserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 王越潇
 * @version 1.0
 * @Date 2024/9/27 20:46
 * @Type
 */
@RestController
@RequestMapping("app/userInfo")
@Api(tags = "用户信息管理")
public class UserInfoController {
    @Resource
    private ApUserInfoService apUserInfoService;
    @PostMapping("addUserInfo")
    @ApiOperation("添加用户信息")
    public ResponseResult addUserInfo(@RequestBody ApUserInfo apUserInfo){
        return apUserInfoService.addUserInfo(apUserInfo);
    }
    @GetMapping("getUserInfo/{id}")
    @ApiOperation("获取用户信息")
    public ResponseResult getUserInfo(@PathVariable("id") Integer id){
        return apUserInfoService.getUserInfo(id);
    }
    @ApiOperation("按照不同的频道查询用户信息")
    @PostMapping("findUsersBySex")
    public ResponseResult findUsersBySex(@RequestBody ApUserInfo apUserInfo){
        return apUserInfoService.findUsersBySex(apUserInfo);
    }
}
